import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/util.dart';
import 'package:industry_net/base/component/component.dart';
import '../../models/chat_list.dart';

import '../controller.dart';

class ChatListCell extends StatelessWidget {
  ChatListCell({Key? key, required this.md}) : super(key: key);

  final ChatListModel md;
  final controller = Get.find<ChatListController>();
  @override
  Widget build(BuildContext context) {
    double _size = 50.r;
    return InkWell(
      onTap: () => controller.actionCellClick(md),
      child: Container(
        padding: EdgeInsets.symmetric(horizontal: gap12, vertical: gap10),
        child: Row(
          children: [
            RedContainer(
              child: loadImage(width: _size, height: _size),
              childSize: _size,
              redCount: 5,
            ),
            SizedBox(
              width: gap10,
            ),
            Expanded(
              child: SizedBox(
                height: _size,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text(
                          '物流客服',
                          style: pfSCStyle(
                              color: ColorsUtil.title, fontSize: font16),
                        ),
                        Text(
                          '2021/12.20',
                          style: pfMediumStyle(
                              color: ColorsUtil.content, fontSize: font13),
                        )
                      ],
                    ),
                    Text(
                      '有超时订单未支付，已被取消',
                      style: pfMediumStyle(
                          color: ColorsUtil.content, fontSize: font13),
                    )
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
